﻿using System;
using NUnit.Framework;

namespace FindLargest
{
	[TestFixture]
	public class LargestTest
	{
		[Test]
		public void TestMethod()
		{
			
			int[] numbers;
			numbers = new int[]{9, 8, 7};
			Assert.That(Cmp.Largest(numbers), Is.EqualTo(9));
			numbers = new int[]{8, 9, 7};
			Assert.That(Cmp.Largest(numbers), Is.EqualTo(9));
			numbers = new int[]{7, 8, 9};
			Assert.That(Cmp.Largest(numbers), Is.EqualTo(9));
		}
		
		[Test]
		public void Dups() {
			Assert.That(Cmp.Largest(new int[] {9,7,9,8}), Is.EqualTo(9));
		}
		
		[Test]
		public void One() {
			Assert.That(Cmp.Largest(new int[] {1}), Is.EqualTo(1));
		}
		
		[Test]
		public void Negative() {
			int[] negatives = new int[] {-9, -8, -7};
			Assert.That(Cmp.Largest(negatives), Is.EqualTo(-7));
		}
		
		[Test]
		[ExpectedException(typeof(ArgumentException))]
		public void Empty() {
			Cmp.Largest(new int[] {});
		}
		
		[Test]
		public void TextStartsWith() {
			Assert.That("My string is larger than...", Is.StringStarting("my string").IgnoreCase);
		}
		
	}
}
